package com.lgqx.springsecurity.web.controller;


import com.lgqx.springsecurity.common.api.ApiResult;
import com.lgqx.springsecurity.web.param.LoginUserParam;
import com.lgqx.springsecurity.web.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhaoz
 */
@RestController
@RequestMapping("/sysUser")
public class SysUserController {

    @Autowired
    private LogService logService;

    /**
     * 自定义登录
     *
     * @param param 登录传参
     * @return
     */
    @PostMapping("/login")
    public ApiResult login(@RequestBody LoginUserParam param) {
        return logService.login(param);
    }

    /**
     * 自定义登出
     *
     * @return
     */
    @PostMapping("/logOut")
    public ApiResult logOut() {
        return logService.logOut();
    }
}

